/**
*	流程模块：扩展js
*	开发者：雨中磐石
*	地址：www.rockoa.com
*	日期：2023-07-20
*/



js.imgroup_list = function(){
	
	this.initbodys = function(){
		
		if(this.iscompany){
			this.setcolumns('ushu', {
				renderer:function(v, d, oi){
					var s = ''+v+'';
					if(d.type=='1')s+=' <a clickevt="addusers,'+oi+'" class="zhu">＋</a>';
					return s;
				}
			});
		}
	}
	
	this.onloadtable = function(d){
		this.table.initbtn(this);
	}
	
	this.addusers = function(o1,oi){
		var d = this.table.getData(oi);
		var me = this;
		importjs('changeuser','create',{
			changetype:'usercheck',
			cnum:this.cnum,
			title:'群组下添加人员',
			onselect:function(san,sid){
				if(sid)me.savegroupuser(sid, d.id, d.type_yval);
			}
		});
	}
	
	this.savegroupuser = function(sid, gid, type){
		var me = this;
		js.ajax.post({
			loading:'添加中...',
			url:this.getacturl('savegroupuser'),
			loadsuccess:'添加成功',
			data:{
				sid:sid,
				gid:gid,
				type:type
			}
		},function(ret){
			me.table.reload();
		});
	}
}